﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Serialization;
using System.Web;

namespace NewHPDNWcfService.Entities
{
    [DataContract]
    public class Table : INotifyPropertyChanged
    {
        public static int FREE = 0;
        public static int BUSY = 1;

        public event PropertyChangedEventHandler PropertyChanged;

        public void OnPropertyChanged(PropertyChangedEventArgs args)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, args);
            }
        }
        [DataMember]
        public int Id { get; set; }

        [DataMember]
        public string TableName { get; set; }
        
        [DataMember]
        public int Capability { get; set; }

        // Status of the table:
        // 0: A free table
        // 1: Table is busy
        private int _status;
        
        [DataMember]
        public int Status
        {
            get { return _status; }
            set
            {
                _status = value;
                OnPropertyChanged(new PropertyChangedEventArgs("Status"));
            }
        }

        public Table()
        {
            this.Id = 1;
            this.TableName = "Table Name";
            this.Capability = 10;
            this._status = 1;
        }
    }
}